// ObjectGL.cpp
//
#include "ObjectGL.h"

using namespace OpenGL;

// ------------------------------------------------------------------------------------------------
ObjectGL::ObjectGL()
: s(1.0),
  t(0.0),
  r(1.0)
{}

// ------------------------------------------------------------------------------------------------
void ObjectGL::setPosition( const Math::vec3 &v )	{ t = v; }

// ------------------------------------------------------------------------------------------------
void ObjectGL::setScale( const Math::vec3 &v )	{ s = v; }

// ------------------------------------------------------------------------------------------------
void ObjectGL::setRotation( double angle, const Math::vec3 &axis ) { r = Math::rotate( Math::mat4(1.0), (float)angle, axis ); }

// ------------------------------------------------------------------------------------------------
Math::mat4 ObjectGL::getTransformed()	{ return r * Math::scale( Math::mat4(1.0), s ); }
